<html>
<head>
<meta name="referrer" content="origin" />
<script>
window.addEventListener("message", receiveMessage, false);

function receiveMessage(evt) {
    if (evt.data == "done") {
        if (window.testRunner)
            testRunner.notifyDone();
    } else if (typeof(evt.data) == "object" && evt.data.action == "click")  {
        var link = document.getElementById("link");
        eventSender.mouseMoveTo(link.offsetLeft + 2, link.offsetTop + 2);
        eventSender.mouseDown();
        eventSender.mouseUp();
    } else {
        document.getElementById("log").innerHTML += evt.data + "<br>";
    }
}
</script>
</head>
<body>
<a id="link" rel="opener" target="_blank" href="https://127.0.0.1:8443/resources/redirect.php?url=http://127.0.0.1:8000/security/resources/referrer-policy-postmessage.php">If not running in DumpRenderTree, click this link</a>
<div id="log"></div>
</body>
</html>
